import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import common from './utils/common'

Vue.use(ElementUI)
Vue.config.productionTip = false

// 组件挂载
Vue.component()

// 方法挂载
Vue.prototype.common = common

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

// DOM更新时调用
Vue.nextTick().then(()=>{
  console.log('dom modify!!!')
})

// 子类
// 若要选择子类，则需要开启runtimeCompiler模式
var Profile = Vue.extend({
  template: '<a>{{firstName}} {{lastName}} aka {{alias}}</a>',
  data: function () {
    return {
      firstName: 'Walter',
      lastName: 'White',
      alias: 'Heisenberg'
    }
  },
  methods: {
    toSome(){
      this.$router.push('/about')
    }
  }
})
// 创建 Profile 实例，并挂载到一个元素上。
new Profile().$mount('#mount-point')